INTRODUCTION ------------ FSTAMP.DLL - A small DLL to allow you to change the date and time stamp of a file from VB or C/C++. FSTAMP is FREEWARE, but remains the copyrighted material of Richard A. Esterling, All Rights Reserved, 1994. Everything else is probably the copyrighted material of someone else. Said author is not responsible for much of anything; certainly nothing having anything to do with YOUR computer. HISTORY ------- Ver 0.02 - Previous version was written in Borland C++ 3.1 using setftime function. This function (or my coding of it) did not seem to like double-digit months; i.e., 11 and 12. It also kept confusing AM with PM and would yeild results like 18:00 am. Not knowing if this was a problem with SmartDrv and setftime or what, I scrapped the Borland version and rewrote the DLL in Visual C++ 1.0. Since VC++ has no similar function, I now use a REGS union and invoke DOS service 21h/57h using the int86() function. To top it off, the DLL ended up about half the size it was when compiled and linked under Borland. Ver 0.01 - Initial release. COMPATIBILITY ------------- As far as I know, FSTAMP.DLL is only compatible with DOS-based systems (running Windows) since a low-level DOS service is utilized to set any given file's date and time stamp. If someone discovers information to the contrary, I'd appreciate being notified just for curiosity's sake. This DLL should work with DOS 2.0 and above, Windows 3.0 or Windows 3.1. INSTALLATION ------------ Copy FSTAMP.DLL to your Windows subdirectory, or into the same directory from which you will be executing your program. USAGE ----- The declaration/prototype: For VB: Declare Function FileStamp% lib "FSTAMP.DLL" (ByVal FileName$,ByVal NewDate$, ByVal NewTime$) For C/C++: int FileStamp(LPSTR fileName, LPSTR newDate, LPSTR newTime); where: "fileName" is any valid path\filename of the file that is to be changed. "newDate" is a valid date. This parameter MUST be eight characters in width. In other words, do not omit 0's. "1/1/94" is NOT a valid date; "01/01/94" is. The date you specify must be later than 1980. What character you use to separate the numbers does not matter (01-01-91 = 01/01/91 = 01.91.91 = 01 01 91) "newTime" is a valid time. This parameter MUST be eight characters is width. In other words, do not omit 0's. "8:15" is NOT a valid time; "08:15:00" is. Note that the time must be specified in military time. Also, while you are allowed to specify an odd number of seconds, DOS only uses even numbers to record the seconds of a filename, so your seconds will be rounded down to the nearest even number. What character you use to separate the numbers does not matter (10:15:00 = 10-15-00 = 10 15 00) RETURN CODES ------------ FileStamp will return 1 out of 6 possible return codes: 0 - No detectable error occurred 1 - newDate variable does not contain eight characters 2 - newTime variable does not contain eight characters 3 - Specified file could not be opened 4 - Internal function call to commit date/time change failed 5 - Specified file could not be closed The errors are listed in "natural" order; i.e., the order in which they occur. Therefore, an error of 5, while hard to fathom, indicates that everything else was successful except for the actual closing of the file. EXAMPLE ------- This zip contains an internal zip file called EXAMPLE.ZIP. Unzip this file and load FILESTMP.MAK into VB for a functional example of how to implement FSTAMP.DLL with your VB program. Or, you can just execute FILESTMP.EXE to see it run. This zip file also contains the latest version (at the time of this writing) of THREED.VBX (07/16/93) since the example utiltizes some 3D panels from this VBX. FEEDBACK -------- I threw this together in one sitting with very little testing because I knew someone was waiting on it. If you have suggestions or would like enhancements, please let me know using one of the methods described below. You might have to wait a week or two, but the price is right . ABOUT THE AUTHOR ---------------- I'm Rick Esterling, a computer scientist for Boeing Information Services contracted to NASA at Marshall Space Flight Center. I can be reached at: Rick Esterling Three Cruse Alley Huntsville, AL 35801 205-536-8568 Internet: esterra@widget.msfc.nasa.gov CIS: 73322,702